<?php
$_base_path = '/var/www/hydraphpframe';
// Include the init for the application
ini_set( 'include_path', ini_get('include_path') .
        PATH_SEPARATOR . $_base_path
        );
require( 'init.inc.php' );

// Example code
// my_DBG( $_SERVER );

$username = 'hydrarulz';
$password = base64_decode('bWFyZmFudWU=');

$urls['login'] = 'http://filelist.ro/takelogin.php';
$urls['browse'][] = 'http://filelist.ro/browse.php';
$urls['browse'][] = 'http://filelist.ro/browse.php?page=1';

// Login

$lurker = curl_init();

$options = array(
    CURLOPT_RETURNTRANSFER      => true,     // return web page
    CURLOPT_HEADER              => false,    // don't return headers
    CURLOPT_FOLLOWLOCATION      => true,     // follow redirects
    CURLOPT_ENCODING            => "",       // handle all encodings
    CURLOPT_USERAGENT           => "spider", // who am i
    CURLOPT_AUTOREFERER         => true,     // set referer on redirect
    CURLOPT_CONNECTTIMEOUT      => 120,      // timeout on connect
    CURLOPT_TIMEOUT             => 120,      // timeout on response
    CURLOPT_MAXREDIRS           => 10,       // stop after 10 redirects
    CURLOPT_SSL_VERIFYHOST      => 0,       // stop after 10 redirects
    CURLOPT_COOKIESESSION       => true
);

curl_setopt_array( $lurker, $options );

curl_setopt( $lurker, CURLOPT_POST, true );
curl_setopt( $lurker, CURLOPT_POSTFIELDS, array(
    'username' => $username,
    'password' => $password
) );

$logged = curl_exec( $lurker );

echo $logged;




?>